package com.hsc.yalebao.tabChongZhi;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.PopupWindow.OnDismissListener;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.ScrollView;
import android.widget.TextView;
import com.google.gson.Gson;
import com.hsc.yalebao.base.ActivityStack;
import com.hsc.yalebao.base.BaseActivity;
import com.hsc.yalebao.base.CustomApplication;
import com.hsc.yalebao.base.MainActivity;
import com.hsc.yalebao.http.AppConstants;
import com.hsc.yalebao.http.RequestNet;
import com.hsc.yalebao.model.GetZZZHlistBaseBean;
import com.hsc.yalebao.model.PayTypeBean;
import com.hsc.yalebao.model.PayTypeListBean;
import com.hsc.yalebao.model.UserBaseBean;
import com.hsc.yalebao.tools.CashierInputFilter;
import com.hsc.yalebao.tools.UiUtil;
import com.hsc.yalebao.tools.Utility;
import com.hsc.yalebao.weight.CustomDialog;
import com.hsc.yalebao.weight.LogUtils;
import com.hsc.yalebao.weight.MyDialog1;
import com.hsc.yalebao.weight.NumberPicker;
import com.hsc.yalebao.weight.NumberPicker.OnValueChangeListener;
import com.hsc.yalebao.weight.viewpager.BannerViewPager;
import com.hsc.yalebao.weight.viewpager.BannerViewPager.OnItemClickListener;
import com.hsc.yalebao.weight.viewpager.ViewFactory;
import com.zhy.http.okhttp.callback.StringCallback;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import okhttp3.Call;

public class XianXiaAliPayActivity extends BaseActivity
  implements View.OnClickListener
{
  private static Context context;
  private static File myCaptureFile;
  private String TAG = "XianXiaAliPayActivity";
  private GetZZZHlistBaseBean bean;
  private ImageView btn_modify;
  private Calendar calendar;
  private NumberPicker day_numberpicker;
  private EditText et_bank_card;
  private EditText et_money;
  private EditText et_real_name;
  private EditText et_user_card_type;
  private int id;
  private String[] imageUrls;
  private ImageView img_user_card_type;
  private List<String> infos = new ArrayList();
  private ImageView iv_down;
  private ImageView iv_qrcode;
  private Button iv_submit;
  private ImageView iv_title_right;
  private int mDay;
  private BannerViewPager mFlBanner;
  private int mMaxNum = 5000000;
  private int mMinNum = 100;
  private int mMonth;
  private PayTypeBean mPayTypeBean;
  private ScrollView mScrollView;
  private int mYear;
  private int memberid;
  private NumberPicker month_numberpicker;
  private MyDialog1 myDialog1;
  View.OnClickListener onClickListener = new View.OnClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      switch (paramAnonymousView.getId())
      {
      case 2131099704:
      default:
        return;
      case 2131099699:
        XianXiaAliPayActivity.this.closeWindowSoftInput(XianXiaAliPayActivity.this.et_real_name);
        XianXiaAliPayActivity.this.closeWindowSoftInput(XianXiaAliPayActivity.this.et_bank_card);
        XianXiaAliPayActivity.this.closeWindowSoftInput(XianXiaAliPayActivity.this.et_money);
        CustomApplication.app.finishActivity(XianXiaAliPayActivity.this);
        return;
      case 2131099715:
        XianXiaAliPayActivity.this.showErWeimaPopupWindow();
        return;
      case 2131099991:
        XianXiaAliPayActivity.this.tv_copy_zhanghao.setBackgroundResource(2130838009);
        XianXiaAliPayActivity.this.delayed(XianXiaAliPayActivity.this.tv_copy_zhanghao);
        String str2 = XianXiaAliPayActivity.this.tv_bankcardid.getText().toString();
        if (TextUtils.isEmpty(str2))
        {
          UiUtil.showToast("复制失败");
          return;
        }
        UiUtil.showToast("复制成功");
        UiUtil.copy(str2, XianXiaAliPayActivity.context);
        return;
      case 2131099993:
      }
      XianXiaAliPayActivity.this.tv_copy_name.setBackgroundResource(2130838009);
      XianXiaAliPayActivity.this.delayed(XianXiaAliPayActivity.this.tv_copy_name);
      String str1 = XianXiaAliPayActivity.this.tv_accountholder.getText().toString();
      if (TextUtils.isEmpty(str1))
      {
        UiUtil.showToast("复制失败");
        return;
      }
      UiUtil.showToast("复制成功");
      UiUtil.copy(str1, XianXiaAliPayActivity.context);
    }
  };
  private List<Integer> payIds = new ArrayList();
  private PopupWindow popupWindow;
  private String qrcode;
  private RelativeLayout rl_select_time;
  private TextView tv_accountholder;
  private TextView tv_bankcardid;
  private ImageView tv_copy_name;
  private ImageView tv_copy_zhanghao;
  private TextView tv_huming_tishi;
  private TextView tv_pay_number;
  private TextView tv_sys_name;
  private View view;
  private View view_title;
  private List<ImageView> views = new ArrayList();

  private void dealPayList(List<PayTypeBean> paramList)
  {
    this.payIds = new ArrayList();
    Iterator localIterator;
    if ((paramList != null) && (paramList.size() > 0))
      localIterator = paramList.iterator();
    while (true)
    {
      if (!localIterator.hasNext())
      {
        if (this.payIds.contains(Integer.valueOf(this.id)))
          break;
        this.myDialog1 = new MyDialog1(this);
        this.myDialog1.setMessage("此充值方式已关闭,请返回选择其他充值方式");
        this.myDialog1.btn_confirm.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymousView)
          {
            XianXiaAliPayActivity.this.myDialog1.dismiss();
          }
        });
        this.myDialog1.show();
        return;
      }
      PayTypeBean localPayTypeBean = (PayTypeBean)localIterator.next();
      try
      {
        int i = Integer.valueOf(localPayTypeBean.getIsSdkEffective()).intValue();
        this.payIds.add(Integer.valueOf(i));
      }
      catch (Exception localException)
      {
      }
    }
    submit();
  }

  private void delayed(final ImageView paramImageView)
  {
    new Handler().postDelayed(new Runnable()
    {
      public void run()
      {
        if (paramImageView != null)
          paramImageView.setBackgroundResource(2130838008);
      }
    }
    , 2000L);
  }

  private void init()
  {
    this.calendar = Calendar.getInstance();
    this.bean = ((GetZZZHlistBaseBean)getIntent().getSerializableExtra("bean"));
    this.mPayTypeBean = ((PayTypeBean)getIntent().getSerializableExtra("payTypeBean"));
    if (this.mPayTypeBean != null)
    {
      this.mMaxNum = ((int)Double.valueOf(this.mPayTypeBean.getMax_paymoney()).doubleValue());
      this.mMinNum = ((int)Double.valueOf(this.mPayTypeBean.getMin_paymoney()).doubleValue());
    }
    this.imageUrls = this.bean.getQrcode().split("\\|");
    String str1 = getIntent().getStringExtra("qrcode");
    this.id = getIntent().getIntExtra("id", 0);
    initTitle();
    this.tv_bankcardid = ((TextView)findViewById(2131099990));
    this.tv_copy_zhanghao = ((ImageView)findViewById(2131099991));
    this.tv_copy_zhanghao.setOnClickListener(this.onClickListener);
    this.tv_copy_name = ((ImageView)findViewById(2131099993));
    this.tv_copy_name.setOnClickListener(this.onClickListener);
    this.tv_accountholder = ((TextView)findViewById(2131099992));
    this.tv_sys_name = ((TextView)findViewById(2131099995));
    this.tv_pay_number = ((TextView)findViewById(2131099997));
    this.iv_qrcode = ((ImageView)findViewById(2131099714));
    this.iv_down = ((ImageView)findViewById(2131099715));
    this.iv_down.setOnClickListener(this.onClickListener);
    this.iv_down.setVisibility(8);
    if (!"".equals(str1))
    {
      LogUtils.e(this.TAG, "qrcode:" + str1);
      String str2 = AppConstants.BASE_URL_IMG + str1;
      LogUtils.e(this.TAG, "qrcodeRel:" + str2);
      this.iv_qrcode.setOnLongClickListener(new View.OnLongClickListener()
      {
        public boolean onLongClick(View paramAnonymousView)
        {
          XianXiaAliPayActivity.this.showErWeimaPopupWindow();
          return false;
        }
      });
    }
    this.img_user_card_type = ((ImageView)findViewById(2131099748));
    this.iv_submit = ((Button)findViewById(2131100001));
    this.et_real_name = ((EditText)findViewById(2131099996));
    this.et_bank_card = ((EditText)findViewById(2131099998));
    this.et_money = ((EditText)findViewById(2131099999));
    this.et_user_card_type = ((EditText)findViewById(2131099735));
    this.rl_select_time = ((RelativeLayout)findViewById(2131100000));
    this.rl_select_time.setOnClickListener(this);
    this.iv_submit.setOnClickListener(this);
    this.et_money.setInputType(3);
    InputFilter[] arrayOfInputFilter = new InputFilter[1];
    arrayOfInputFilter[0] = new CashierInputFilter();
    this.et_money.setFilters(arrayOfInputFilter);
    this.mScrollView = ((ScrollView)findViewById(2131099989));
    this.mFlBanner = ((BannerViewPager)findViewById(2131099994));
    initViewPager();
    this.et_money.setHint("请填写您此次转账的金额(" + this.mMinNum + "-" + this.mMaxNum + ")");
  }

  private void initData()
  {
    if (this.bean != null)
    {
      this.tv_bankcardid.setText(this.bean.bankcardid);
      this.tv_accountholder.setText(this.bean.accountholder);
      if ("2".equals(this.bean.ctype))
      {
        this.tv_sys_name.setText("支付宝户名  ");
        this.tv_pay_number.setText("支付宝帐号  ");
        this.et_real_name.setHint("请填写您此次转账使用的支付宝户名");
        this.et_bank_card.setHint("请填写您此次转账使用的支付宝帐号");
      }
      if ("3".equals(this.bean.ctype))
      {
        this.tv_sys_name.setText("微信户名  ");
        this.tv_pay_number.setText("微信帐号  ");
        this.et_real_name.setHint("请填写您此次转账使用的微信户名");
        this.et_bank_card.setHint("请填写您此次转账使用的微信帐号");
      }
      if ("4".equals(this.bean.ctype))
        this.tv_sys_name.setText("财付通户名  ");
    }
    this.mScrollView.smoothScrollTo(0, 20);
  }

  private void initTitle()
  {
    String str;
    if (this.bean != null)
    {
      str = "";
      if (!"1".equals(this.bean.ctype))
        break label50;
      str = "填写存款信息";
    }
    while (true)
    {
      setTitle(8, 0, 2130837809, str, 0, 8, 8, 0, true);
      return;
      label50: if ("2".equals(this.bean.ctype))
        str = "支付宝转账";
      else if ("3".equals(this.bean.ctype))
        str = "微信转账";
      else if ("4".equals(this.bean.ctype))
        str = "财付通转账";
    }
  }

  private void initViewPager()
  {
    int i = 0;
    if (i >= this.imageUrls.length)
      this.views.add(ViewFactory.getImageView(this, (String)this.infos.get(-1 + this.infos.size())));
    for (int j = 0; ; j++)
    {
      if (j >= this.infos.size())
      {
        this.views.add(ViewFactory.getImageView(this, (String)this.infos.get(0)));
        this.mFlBanner.setData(this.views, this.infos, new BannerViewPager.OnItemClickListener()
        {
          public void onItemClick(int paramAnonymousInt)
          {
          }
        });
        this.mFlBanner.setLayoutParams(new RelativeLayout.LayoutParams(-1, -65 + Utility.getScreenWidth(this)));
        this.mFlBanner.setWheel(true);
        this.mFlBanner.setScrollTime(3000);
        this.mFlBanner.setIndicatorCenter();
        return;
        this.infos.add(AppConstants.BASE_URL_IMG + this.imageUrls[i]);
        i++;
        break;
      }
      this.views.add(ViewFactory.getImageView(this, (String)this.infos.get(j)));
    }
  }

  public static void saveFile(Bitmap paramBitmap, String paramString1, String paramString2)
    throws IOException
  {
    String str = Environment.getExternalStorageDirectory().getAbsolutePath() + paramString2;
    File localFile = new File(str);
    if (!localFile.exists())
      localFile.mkdirs();
    myCaptureFile = new File(str, paramString1);
    if (!myCaptureFile.exists())
      myCaptureFile.createNewFile();
    BufferedOutputStream localBufferedOutputStream = new BufferedOutputStream(new FileOutputStream(myCaptureFile));
    paramBitmap.compress(Bitmap.CompressFormat.JPEG, 80, localBufferedOutputStream);
    UiUtil.showToast(context, "保存二维码成功");
    localBufferedOutputStream.flush();
    localBufferedOutputStream.close();
  }

  private void sendzhifu(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    String str = "支付宝转账";
    if (this.id == 2)
      str = "支付宝转账";
    while (true)
    {
      HashMap localHashMap = new HashMap();
      localHashMap.put("memberid", this.memberid);
      localHashMap.put("real_name", paramString1);
      localHashMap.put("bank_card", paramString3);
      localHashMap.put("bank_name", str);
      localHashMap.put("bank_id", this.bean.id);
      localHashMap.put("money", paramString2);
      localHashMap.put("paytype", "1");
      localHashMap.put("paymentid", this.id);
      LogUtils.d(this.TAG, "URL:" + AppConstants.URL_GET_SUBMITTRANSMONEY);
      setLoginBtnIsEnable(false);
      RequestNet.get(context, AppConstants.URL_GET_SUBMITTRANSMONEY, localHashMap, new StringCallback()
      {
        public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
        {
          XianXiaAliPayActivity.this.setLoginBtnIsEnable(true);
          LogUtils.e(XianXiaAliPayActivity.this.TAG, "联网失败,sendzhifu-result:" + paramAnonymousException);
        }

        public void onResponse(String paramAnonymousString)
        {
          XianXiaAliPayActivity.this.setLoginBtnIsEnable(true);
          if ((paramAnonymousString == null) || ("".equals(paramAnonymousString)))
          {
            LogUtils.e(XianXiaAliPayActivity.this.TAG, "result:" + paramAnonymousString);
            UiUtil.showToast("提交失败，请重试");
          }
          XianXiaAliPayActivity.Result localResult;
          do
          {
            return;
            Gson localGson = new Gson();
            try
            {
              localResult = (XianXiaAliPayActivity.Result)localGson.fromJson(paramAnonymousString, XianXiaAliPayActivity.Result.class);
              if (localResult == null)
              {
                LogUtils.e(XianXiaAliPayActivity.this.TAG, "Result == null，获取失败");
                UiUtil.showToast("提交失败，请重试");
                return;
              }
            }
            catch (Exception localException)
            {
              while (true)
              {
                localException.printStackTrace();
                localResult = null;
              }
              System.out.println("获取flag=" + localResult.flag);
              if (localResult.flag == 0)
              {
                if (localResult.msg != null)
                  XianXiaAliPayActivity.this.ShowDialog1(localResult.msg);
                LogUtils.e(XianXiaAliPayActivity.this.TAG, "提交支付记录:" + localResult.msg);
                return;
              }
              if (localResult.flag == -4)
              {
                XianXiaAliPayActivity.activityStack.backToMain(MainActivity.class, XianXiaAliPayActivity.context);
                return;
              }
              if (localResult.flag == -2)
              {
                XianXiaAliPayActivity.this.showDownWireDialog();
                return;
              }
              if (localResult.flag == -3)
              {
                XianXiaAliPayActivity.this.ShowFengjinDialog();
                return;
              }
            }
          }
          while (localResult.flag != 1);
          if (localResult.msg == null)
          {
            System.out.println("服务器返回数据错误=" + localResult.msg + "=null");
            return;
          }
          XianXiaAliPayActivity.this.ShowDialog1(localResult.msg);
          XianXiaAliPayActivity.this.et_real_name.setText("");
          XianXiaAliPayActivity.this.et_money.setText("");
          XianXiaAliPayActivity.this.et_bank_card.setText("");
        }
      });
      return;
      if (this.id == 3)
        str = "微信转账";
    }
  }

  private void setLoginBtnIsEnable(boolean paramBoolean)
  {
    this.iv_submit.setEnabled(paramBoolean);
  }

  @SuppressLint({"NewApi"})
  @TargetApi(12)
  private void showtimePopwindow()
  {
    this.img_user_card_type.setImageResource(2130837882);
    this.view = LayoutInflater.from(context).inflate(2130903178, null);
    int i = 6 * (CustomApplication.app.displayMetrics.widthPixels / 10);
    NumberPicker localNumberPicker;
    int j;
    int k;
    if (this.popupWindow == null)
    {
      this.view = LayoutInflater.from(context).inflate(2130903178, null);
      this.popupWindow = new PopupWindow(this.view, -2, -2, true);
      LinearLayout localLinearLayout = (LinearLayout)this.view.findViewById(2131099762);
      ViewGroup.LayoutParams localLayoutParams = localLinearLayout.getLayoutParams();
      localLayoutParams.width = i;
      localLinearLayout.setLayoutParams(localLayoutParams);
      this.day_numberpicker = ((NumberPicker)this.view.findViewById(2131100237));
      this.day_numberpicker.setMinValue(1);
      this.day_numberpicker.setMaxValue(30);
      this.mDay = this.calendar.get(5);
      this.day_numberpicker.setValue(this.mDay);
      localNumberPicker = (NumberPicker)this.view.findViewById(2131100234);
      localNumberPicker.setMaxValue(2045);
      localNumberPicker.setMinValue(2015);
      this.mYear = this.calendar.get(1);
      localNumberPicker.setValue(this.mYear);
      j = localNumberPicker.getValue();
      this.month_numberpicker = ((NumberPicker)this.view.findViewById(2131100236));
      this.month_numberpicker.setMaxValue(12);
      this.month_numberpicker.setMinValue(1);
      this.mMonth = (1 + this.calendar.get(2));
      this.month_numberpicker.setValue(this.mMonth);
      k = this.month_numberpicker.getValue();
      if ((k != 1) && (k != 3) && (k != 5) && (k != 7) && (k != 8) && (k != 10) && (k != 12))
        break label462;
      this.day_numberpicker.setMaxValue(31);
    }
    while (true)
    {
      localNumberPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
      {
        public void onValueChange(NumberPicker paramAnonymousNumberPicker, int paramAnonymousInt1, int paramAnonymousInt2)
        {
          XianXiaAliPayActivity.this.mYear = paramAnonymousInt2;
        }
      });
      this.month_numberpicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
      {
        public void onValueChange(NumberPicker paramAnonymousNumberPicker, int paramAnonymousInt1, int paramAnonymousInt2)
        {
          XianXiaAliPayActivity.this.mMonth = paramAnonymousInt2;
          if ((paramAnonymousInt2 == 1) || (paramAnonymousInt2 == 3) || (paramAnonymousInt2 == 5) || (paramAnonymousInt2 == 7) || (paramAnonymousInt2 == 8) || (paramAnonymousInt2 == 10) || (paramAnonymousInt2 == 12))
            XianXiaAliPayActivity.this.day_numberpicker.setMaxValue(31);
          while (true)
          {
            LogUtils.i(XianXiaAliPayActivity.this.TAG, "mMonth:" + XianXiaAliPayActivity.this.mMonth);
            return;
            if ((paramAnonymousInt2 == 4) || (paramAnonymousInt2 == 6) || (paramAnonymousInt2 == 9) || (paramAnonymousInt2 == 11))
              XianXiaAliPayActivity.this.day_numberpicker.setMaxValue(30);
            else if (XianXiaAliPayActivity.this.mYear / 4 == 0)
              XianXiaAliPayActivity.this.day_numberpicker.setMaxValue(29);
            else
              XianXiaAliPayActivity.this.day_numberpicker.setMaxValue(28);
          }
        }
      });
      this.day_numberpicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
      {
        public void onValueChange(NumberPicker paramAnonymousNumberPicker, int paramAnonymousInt1, int paramAnonymousInt2)
        {
          XianXiaAliPayActivity.this.mDay = paramAnonymousInt2;
          LogUtils.i(XianXiaAliPayActivity.this.TAG, "mDay:" + XianXiaAliPayActivity.this.mDay);
        }
      });
      this.popupWindow.setOutsideTouchable(true);
      this.popupWindow.setFocusable(true);
      this.popupWindow.setBackgroundDrawable(context.getResources().getDrawable(2130838170));
      this.popupWindow.showAsDropDown(this.et_user_card_type, 0, 0);
      this.popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener()
      {
        private String month;

        public void onDismiss()
        {
          XianXiaAliPayActivity.this.img_user_card_type.setImageResource(2130837881);
          String str1 = XianXiaAliPayActivity.this.mYear;
          String str2 = XianXiaAliPayActivity.this.format(XianXiaAliPayActivity.this.mMonth);
          String str3 = XianXiaAliPayActivity.this.format(XianXiaAliPayActivity.this.mDay);
          String str4 = str1 + "-" + str2 + "-" + str3;
          XianXiaAliPayActivity.this.et_user_card_type.setText(str4);
        }
      });
      return;
      label462: if ((k == 4) || (k == 6) || (k == 9) || (k == 11))
        this.day_numberpicker.setMaxValue(30);
      else if (j / 4 == 0)
        this.day_numberpicker.setMaxValue(29);
      else
        this.day_numberpicker.setMaxValue(28);
    }
  }

  private void submit()
  {
    String str1 = this.et_real_name.getText().toString();
    String str2 = this.et_money.getText().toString();
    String str3 = this.et_bank_card.getText().toString();
    String str4 = this.et_user_card_type.getText().toString();
    if (TextUtils.isEmpty(str1))
    {
      UiUtil.showToast("请填写户名");
      return;
    }
    if ((this.bean != null) && ("2".equals(this.bean.ctype)) && (!UiUtil.isAllChinese(str1)))
    {
      UiUtil.showToast("请检查您的户名");
      return;
    }
    if (TextUtils.isEmpty(str3))
    {
      UiUtil.showToast("请填写账号");
      return;
    }
    if (TextUtils.isEmpty(str2))
    {
      UiUtil.showToast("请填写金额");
      return;
    }
    if ("".equals(str2))
    {
      UiUtil.showToast("请填写金额");
      return;
    }
    try
    {
      if (Double.parseDouble(str2) > this.mMaxNum)
      {
        UiUtil.showToast("金额不能超过" + this.mMaxNum);
        return;
      }
    }
    catch (Exception localException1)
    {
      localException1.printStackTrace();
      try
      {
        if (Double.parseDouble(str2) < this.mMinNum)
        {
          UiUtil.showToast("金额不能低于" + this.mMinNum);
          return;
        }
      }
      catch (Exception localException2)
      {
        localException2.printStackTrace();
        sendzhifu(str1, str2, str3, str4);
      }
    }
  }

  public String format(int paramInt)
  {
    String str = String.valueOf(paramInt);
    if (paramInt < 10)
      str = "0" + str;
    return str;
  }

  public void getPayTypeList()
  {
    HashMap localHashMap = new HashMap();
    if (CustomApplication.app.userBaseBean == null)
      return;
    localHashMap.put("memberid", CustomApplication.app.userBaseBean.getMemberid());
    RequestNet.get(this, AppConstants.URL_GETPAYSTATE, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(XianXiaAliPayActivity.this.TAG, "获取失败getoauthuserstate()-result:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        Gson localGson = new Gson();
        try
        {
          localPayTypeListBean = (PayTypeListBean)localGson.fromJson(paramAnonymousString, PayTypeListBean.class);
          if (localPayTypeListBean == null)
            return;
        }
        catch (Exception localException)
        {
          PayTypeListBean localPayTypeListBean;
          do
          {
            while (true)
            {
              localException.printStackTrace();
              localPayTypeListBean = null;
            }
            if (localPayTypeListBean.getFlag() == -4)
            {
              ActivityStack.getInstance().backToMain(MainActivity.class, XianXiaAliPayActivity.this);
              return;
            }
            if (localPayTypeListBean.getFlag() == 0)
            {
              XianXiaAliPayActivity.this.ShowDialog1(localPayTypeListBean.getMsg());
              return;
            }
            if (localPayTypeListBean.getFlag() == -2)
            {
              MainActivity.mainActivity.showOffLineDialog();
              return;
            }
            if (localPayTypeListBean.getFlag() == -3)
            {
              MainActivity.mainActivity.showFengjinDialog();
              return;
            }
          }
          while (localPayTypeListBean.getFlag() != 1);
          XianXiaAliPayActivity.this.dealPayList(localPayTypeListBean.getResult());
        }
      }
    });
  }

  public void onClick(View paramView)
  {
    switch (paramView.getId())
    {
    default:
      return;
    case 2131100000:
      showtimePopwindow();
      return;
    case 2131100001:
    }
    getPayTypeList();
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903093);
    CustomApplication.app.addActivity(this);
    context = this;
    if (CustomApplication.app.userBaseBean != null)
      this.memberid = CustomApplication.app.userBaseBean.getMemberid();
    init();
    initData();
  }

  protected void onDestroy()
  {
    super.onDestroy();
  }

  protected void onPause()
  {
    super.onPause();
    if (myCaptureFile != null)
      sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(myCaptureFile)));
    closeWindowSoftInput(this.et_real_name);
    closeWindowSoftInput(this.et_bank_card);
    closeWindowSoftInput(this.et_money);
  }

  @SuppressLint({"NewApi"})
  public void setTitle(int paramInt1, int paramInt2, int paramInt3, String paramString, int paramInt4, int paramInt5, int paramInt6, int paramInt7, boolean paramBoolean)
  {
    View localView = findViewById(2131099716);
    if (paramBoolean)
      localView.setVisibility(0);
    while (true)
    {
      ((TextView)localView.findViewById(2131099701)).setText(paramString);
      ((TextView)localView.findViewById(2131099700)).setVisibility(paramInt1);
      ImageView localImageView = (ImageView)localView.findViewById(2131099699);
      localImageView.setVisibility(paramInt2);
      localImageView.setOnClickListener(this.onClickListener);
      localImageView.setImageResource(paramInt3);
      TextView localTextView = (TextView)localView.findViewById(2131099702);
      localTextView.setVisibility(paramInt5);
      localTextView.setOnClickListener(this.onClickListener);
      this.iv_title_right = ((ImageView)localView.findViewById(2131099704));
      this.iv_title_right.setVisibility(paramInt6);
      this.iv_title_right.setOnClickListener(this.onClickListener);
      this.iv_title_right.setImageResource(paramInt7);
      return;
      localView.setVisibility(8);
    }
  }

  public void showErWeimaPopupWindow()
  {
    View localView = LayoutInflater.from(this).inflate(2130903172, null);
    TextView localTextView1 = (TextView)localView.findViewById(2131100231);
    TextView localTextView2 = (TextView)localView.findViewById(2131100232);
    final CustomDialog localCustomDialog = new CustomDialog(this, 2131361804).create(localView, true, 1.0F, 0.2F, 1.0F);
    localCustomDialog.show();
    localTextView1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        Bitmap localBitmap = ((BitmapDrawable)XianXiaAliPayActivity.this.iv_qrcode.getDrawable()).getBitmap();
        try
        {
          if (XianXiaAliPayActivity.this.bean != null)
          {
            if ("3".equals(XianXiaAliPayActivity.this.bean.ctype))
              XianXiaAliPayActivity.saveFile(localBitmap, "qrcode.jpg", "/pic");
            while (true)
            {
              localCustomDialog.dismiss();
              return;
              XianXiaAliPayActivity.saveFile(localBitmap, "qrcode2.jpg", "/pic");
            }
          }
        }
        catch (IOException localIOException)
        {
          while (true)
          {
            localIOException.printStackTrace();
            continue;
            XianXiaAliPayActivity.saveFile(localBitmap, "qrcode.jpg", "/pic");
          }
        }
      }
    });
    localTextView2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        localCustomDialog.dismiss();
      }
    });
  }

  static class Result
  {
    public int flag;
    public String msg;
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.tabChongZhi.XianXiaAliPayActivity
 * JD-Core Version:    0.6.2
 */